package com.copa.l342;

/**
 * @author copa
 * @createDate 2022-07-04 22:15
 * @function 位运算法
 */
public class Test2 {

    public boolean isPowerOfFour(int n) {
        if (n < 1) {
            return false;
        }
        return (n & (n - 1)) == 0 && n % 3 == 1;
    }

    public static void main(String[] args) {
        System.out.println(new Test2().isPowerOfFour(4));
    }
}
